<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>报表管理</title>
    <th:block th:include="~{common/common::commonHead}"/>
</head>
<body>
<div class="page-body">
    <div class="panel panel-primary">
        <div class="panel-heading bg-blue">
            报表管理
        </div>
        <div class="widget-body grid-table">
            <div class="toolbar">
                <div class="toolbar-right">
                    <div class="fl-right">
                        <div class="btn-group" role="group">
                            <button data-click="toggleFilter()" class="btn btn-default text-center">
                                <i class="fa fa-filter fa-fw"></i>
                            </button>
                            <button data-click="refresh('reportList')" class="btn btn-default">
                                <i class="fa fa-refresh fa-fw"></i>
                            </button>
                            <button data-click="download('reportList')" class="btn btn-default">
                                <i class="fa fa-download fa-fw"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div id="reportList"></div>
            <!--筛选-->
            <form class="filter search-content form-horizontal" role="form">
                <div class="col-xs-6">
                    <div class="form-group">
                        <label class="col-xs-4 control-label"> 犯人姓名 </label>
                        <div class="col-xs-8">
                            <div class="iconic-input right">
                                <input name="goodsName" type="text" class="form-control spinner"
                                       placeholder="请输入犯人姓名">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="form-group">
                        <label class="col-xs-4 control-label"> 供应商名称 </label>
                        <div class="col-xs-8">
                            <div class="iconic-input right">
                                <input name="supplierName" type="text" class="form-control spinner"
                                       placeholder="请输入供应商名称">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="form-group">
                        <label class="col-xs-4 control-label"> 结算时间 </label>
                        <div class="col-xs-8">
                            <div class="iconic-input right">
                                <input name="supplierName" type="text" class="form-control spinner"
                                       placeholder="请输入结算时间">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12">
                    <button type="button" data-click="hideFilter()" class="btn btn-default pull-right">取消</button>
                    <button type="button" data-click="submitFilter('reportList')" class="btn btn-blue pull-right">
                        确定
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
<script>
    $(function () {
        $("#reportList").gridTable({
            url: "report/pageReport",
            columns: [
                {title: "报告编号", field: "reportId"},
                {title: "报告名称", field: "reportName"},
                {title: "报告时间", field: "createTime"},
                {title: "报告类型", field: "reportType"},
                {title: "当期销售商品量", field: "goodsSoldQuantityCurrent", dataType: "number"},
                {title: "当期采购商品量", field: "goodsBoughtQuantityCurrent", dataType: "number"},
                {title: "当期销售金额", field: "goodsSoldAmountCurrent", dataType: "decimal"},
                {title: "当期采购金额", field: "goodsBoughtAmountCurrent", dataType: "decimal"},
                {title: "当期收益", field: "profitCurrent", dataType: "decimal"},
                {title: "当期最热门商品", field: "hottestGoodsCurrent", format: function() {return "毛巾"}},
                {title: "当期最热门商品类型", field: "hottestGoodsTypeCurrent", format: function() {return "生活用品"}},
                {title: "总销售商品量", field: "goodsSoldQuantityTotal", dataType: "number"},
                {title: "总采购商品量", field: "goodsBoughtQuantityTotal", dataType: "number"},
                {title: "总销售金额", field: "goodsSoldAmountTotal", dataType: "decimal"},
                {title: "总采购金额", field: "goodsBoughtAmountTotal", dataType: "decimal"},
                {title: "总收益", field: "profitTotal", dataType: "decimal"},
                {title: "最热门商品", field: "hottestGoodsTotal", format: function() {return "毛巾"}},
                {title: "最热门商品类型", field: "hottestGoodsTypeTotal", format: function() {return "生活用品"}}
            ],
            onDoubleClickRow: "info",
            showControl: false,
            idField: "reportId",
            infoUrl: "report/reportInfo.html"
        });
    });
</script>